local sk_le__jiqiao = fk.CreateSkill {

  name = "sk_le__jiqiao",

  tags = { Skill.Compulsory },

}

Fk:loadTranslationTable {
  ["sk_le__jiqiao"] = "机巧",
  [":sk_le__jiqiao"] = "锁定技，你使用锦囊牌无距离限制，不能被其他角色响应。摸牌阶段，你额外从牌堆获得不同牌名的非延时锦囊牌各一张。"
}

sk_le__jiqiao:addEffect(fk.EventPhaseStart, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk_le__jiqiao.name) and player.phase == Player.Draw
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local c_name = {}
    local getCards = {}
    for _, cid in ipairs(room.draw_pile) do
      if Fk:getCardById(cid):isCommonTrick() and not table.contains(c_name, Fk:getCardById(cid).name) then
        table.insertIfNeed(c_name, Fk:getCardById(cid).name)
        table.insertIfNeed(getCards, cid)
      end
    end
    room:obtainCard(player, getCards, false, fk.ReasonPrey, player, sk_le__jiqiao.name)
  end,
})

sk_le__jiqiao:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  priority = 2.5,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk_le__jiqiao.name) and data.card
        and data.card.type == Card.TypeTrick
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data.disresponsiveList = data.disresponsiveList or {}
    for _, p in ipairs(room.alive_players) do
      if p ~= player then
        table.insertIfNeed(data.disresponsiveList, p)
      end
    end
  end,
})

sk_le__jiqiao:addEffect("targetmod", {
  bypass_distances = function(self, player, skill, card, to)
    return player:hasSkill(sk_le__jiqiao.name) and card.type == Card.TypeTrick
  end
})


return sk_le__jiqiao
